import request from "@/utils/request";
export const addKnowPointInfo = async (data: any) => {
  return await request.post(
    `courseManage/addKnowPointInfo?sectionId=${data.sectionId}&sectionName=${data.sectionName}&knowPointId=${data.knowPointId}&knowPointName=${data.knowPointName}&describes=${data.describes}&summary=${data.summary}`,
    data
  );
};
export const courseManage = async (params: { sectionId: number }): Promise<ICourse[]> => {
  return await request.get("/courseManage/knowPointInfo", { params });
};
export const updateKnowPointInfo = async (data: any) => {
  return await request.put(
    `/courseManage/updateKnowPointInfo?id=${data.id}&sectionId=${data.sectionId}&sectionName=${data.sectionName}&knowPointId=${data.knowPointId}&knowPointName=${data.knowPointName}&describes=${data.describes}&summary=${data.summary}`,
    data
  );
};
export const removeKnowPoint = async (params: {
  knowPointId: string | number;
  sectionId: string | number;
}) => {
  return await request.delete("/courseManage/deleteKnowPointInfo", { params });
};
export interface ICourse {
  id: string;
  sectionName: string;
  describes: string;
  summary: string;
  sectionId: string;
  knowPointId: string;
  knowPointName: string;
}
